import Vue from 'vue'
import Router from 'vue-router'
import login from '@/views/login' 
import register from '@/views/register'
import home from '@/views/home'
import promote from '@/views/promote'
import updateInfo from '@/views/updateInfo'
import promoteAdd from '@/views/promote-add'

import parkingSpaceManager from '@/views/parking-space-manager'
import householdShow from '@/views/household-show'
import householdAdd from '@/views/household-add'
import changePwd from '@/views/changePwd'
import parkingSpaceAdd from '@/views/parking-space-add'
import parkingSpaceDesign from '@/views/parking-space-design'

import saleAdd from '@/views/sale-add'
import saleShow from '@/views/sale-show'

import orderShow from '@/views/order-show'

import couponShow from '@/views/coupon-show'
import couponAdd from '@/views/coupon-add'
import promoteUpdate from '@/views/promote-update'
import householdUpdate from '@/views/household-update'
Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/login',
      component: login
    },

    {
      path: '/register',
      name: 'regiter',
      component: register
    },
    {
      path:'/home',
      redirect:"/home/parking-space-manager",
      name:'home',
      component:home,
      children:[
        {
          path:'household-update',
          component:householdUpdate 
        },
        {
          path:'promote-update',
          component:promoteUpdate
        },
        {
          path:'coupon-add',
          component:couponAdd,
          name:'coupon-add'
        },
        {
          path:'coupon-show',
          component:couponShow
        },
        {
          path:"order-show",
          component:orderShow
        },
   
        {
          path:"parking-space-design",
          component:parkingSpaceDesign
        },
        {
          path:"parking-space-manager",
          component:parkingSpaceManager
        },
        {
          path:'parking-space-add',
          component:parkingSpaceAdd
        },
        {
          path:"sale-show",
          component:saleShow
        },
        {
          path:"sale-add",
          component:saleAdd
        },
        {path:'changePwd',
          component:changePwd
        },
        {
          path:"household-show",
          component:householdShow
        },
        {
          path:"household-add",
          component:householdAdd
        },
        {
          path:"promote",
          component:promote,
          name:'promote'
        },
        {
          path:"promote-add",
          component:promoteAdd
        },
        {
          path:"updateInfo",
          component:updateInfo
        },
  
        
      ]
    }
  ]
})
